package com.sdx.console.orgmain.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.beetl.sql.core.annotatoin.ColumnIgnore;
import org.beetl.sql.core.annotatoin.AutoID;
import org.beetl.sql.core.annotatoin.SeqID;
import org.apache.commons.lang3.StringUtils;
import com.ibeetl.admin.core.util.ValidateConfig;
import com.sdx.service.ConfigService;

import org.beetl.sql.core.TailBean;
import java.math.*;

import com.ibeetl.admin.core.annotation.Dict;
import com.ibeetl.admin.core.entity.BaseEntity;

import org.beetl.sql.core.annotatoin.InsertIgnore;
import org.beetl.sql.core.annotatoin.Version;
import org.beetl.sql.core.annotatoin.LogicDelete;
import com.sdx.common.utils.Utils;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

/* 
* 
* gen by Spring Boot2 Admin 2019-04-15
*/
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
@Data
public class OrgLecture extends BaseEntity{

    //讲座ID
    @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class)
    @AutoID	
    private Long lectureId ;
	
    //讲座主题
    private String lectureTitle ;
	
    //讲座主图
    private String mainImg ;
	
    //讲座图片集合[@]
    private String lectureImgs ;
	
    //讲座老师id
    private String customerId ;
	
    //讲座老师姓名
    private String mainTeacher ;
	
    //讲座内容
    private String lectureContent ;
	
    //联系人
    private String contactName ;
	
    //联系电话
    private String contactPhone ;
	
    //定位名称-地址
    private String locationName ;
	
    //地图坐标
    private String locationPoint ;
	
    //讲座时间
   // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private String lectureTime ;
	
    //注意事项
    private String lectureRemark ;
	
    //讲座省份ID
    private Integer provinceId ;
	
    //创建时间
    private Date createdTime ;
	
    //更新时间
    private Date updatedTime ;
	
    //推送时间
    private Date sendTime ;
	
    //创建人
    private String createdBy ;
	
    //创建人名称
    private String createdName ;
	
    //更新人
    private String updatedBy ;
	
    //更新人名称
    private String updatedName ;

    //所在省份
    private String provName;

    private Date startTime;

    private Date endTime;
	
	public String getMainImgView(){
		return Utils.imageUrl(mainImg);
	}

	private String lectureTimeQuery;

    public void setLectureTimeQuery(String lectureTimeQuery) {
        this.lectureTimeQuery = lectureTimeQuery;
        Date[] timePair = Utils.parseQueryTime(lectureTimeQuery);
        if (timePair!=null && timePair[0]!=null) {
            this.startTime = timePair[0];
        }
        if (timePair!=null && timePair.length==2 && timePair[1]!=null) {
            this.endTime = timePair[1];
        }
    }
}
